﻿using System;
using System.Windows;
using System.Windows.Media;

namespace LpbPrj.Client.Controls;

/// <summary>
/// VolumeOptAttach
/// </summary>
public class VolumeOptAttach
{
    /// <summary>
    /// 滑块图
    /// </summary>
    public static readonly DependencyProperty SilderImageSourceProperty = DependencyProperty.RegisterAttached(
        "SilderImageSource", typeof(ImageSource), typeof(VolumeOptAttach), new FrameworkPropertyMetadata(default(ImageSource), FrameworkPropertyMetadataOptions.Inherits));
    public static void SetSilderImageSource(DependencyObject element, ImageSource value) => element.SetValue(SilderImageSourceProperty, value);
    public static ImageSource GetSilderImageSource(DependencyObject element) => (ImageSource)element.GetValue(SilderImageSourceProperty);
    /// <summary>
    /// 滑块边距
    /// </summary>
    public static readonly DependencyProperty SilderMarginProperty = DependencyProperty.RegisterAttached(
        "SilderMargin", typeof(Thickness), typeof(VolumeOptAttach), new FrameworkPropertyMetadata(new Thickness(5, 0, 0, 0), FrameworkPropertyMetadataOptions.Inherits));
    public static void SetSilderMargin(DependencyObject element, Thickness value) => element.SetValue(SilderMarginProperty, value);
    public static Thickness GetSilderMargin(DependencyObject element) => (Thickness)element.GetValue(SilderMarginProperty);

    /// <summary>
    /// 音量（滑块左侧）背景色
    /// </summary>
    public static readonly DependencyProperty VolumeBrushProperty = DependencyProperty.RegisterAttached(
        "VolumeBrush", typeof(Brush), typeof(VolumeOptAttach), new FrameworkPropertyMetadata(Brushes.Red, FrameworkPropertyMetadataOptions.Inherits));
    public static void SetVolumeBrush(DependencyObject element, Brush value) => element.SetValue(VolumeBrushProperty, value);
    public static Brush GetVolumeBrush(DependencyObject element) => (Brush)element.GetValue(VolumeBrushProperty);
    /// <summary>
    /// 音量（滑块左侧）背景色边距
    /// </summary>
    public static readonly DependencyProperty VolumeMarginProperty = DependencyProperty.RegisterAttached(
        "VolumeMargin", typeof(Thickness), typeof(VolumeOptAttach), new FrameworkPropertyMetadata(new Thickness(0, 0, 5, 0), FrameworkPropertyMetadataOptions.Inherits));
    public static void SetVolumeMargin(DependencyObject element, Thickness value) => element.SetValue(VolumeMarginProperty, value);
    public static Thickness GetVolumeMargin(DependencyObject element) => (Thickness)element.GetValue(VolumeMarginProperty);
    /// <summary>
    /// 音量（滑块左侧）最大宽
    /// </summary>
    public static readonly DependencyProperty VolumeMaxWidthProperty = DependencyProperty.RegisterAttached(
        "VolumeMaxWidth", typeof(double), typeof(VolumeOptAttach), new FrameworkPropertyMetadata(10.0, FrameworkPropertyMetadataOptions.Inherits));
    public static void SetVolumeMaxWidth(DependencyObject element, double value) => element.SetValue(VolumeMaxWidthProperty, value);
    public static double GetVolumeMaxWidth(DependencyObject element) => (double)element.GetValue(VolumeMaxWidthProperty);
    /// <summary>
    /// 音量（滑块左侧）高
    /// </summary>
    public static readonly DependencyProperty VolumeHeigthProperty = DependencyProperty.RegisterAttached(
        "VolumeHeigth", typeof(double), typeof(VolumeOptAttach), new FrameworkPropertyMetadata(5.0, FrameworkPropertyMetadataOptions.Inherits));
    public static void SetVolumeHeigth(DependencyObject element, double value) => element.SetValue(VolumeHeigthProperty, value);
    public static double GetVolumeHeigth(DependencyObject element) => (double)element.GetValue(VolumeHeigthProperty);
    
}